#ifndef _INCLUDE_MQTT_MQTTERROR_H_
#define _INCLUDE_MQTT_MQTTERROR_H_

/**
 * @brief mqtt 协议错误码
 */
typedef enum {
    paramsIsNull                           = 0x0100,
    paramsOutOfRange,
    paramsMissingProductKey,
    paramsMissingDeviceName,
    paramsMissingDeviceNo,
    paramsMissingDeviceSecret,
    paramsMissingHost,
    disableExecute,
    registerModeHasDefine,
    registerModeNoDefine,

    memoryMallocFailed                      = 0x0201,
    networkInvalidOption,
    networkEstablishFailed,
    networkClosed,
    networkReadLessData,
    networkWriteLessData,
    networkSendError,
    networkRecvError,
    networkSelectError,
    networkSocketCreateFailed,
    networkDNSFailed,
    networkConnectFailed,
    networkWaitTimeout,

    mqttConnectAckParseError                = 0x0301,
    mqttVersionUnsupport,
    mqttServerUnavalidable,
    mqttAccountInvalid,
    mqttNotAuthorized,
    mqttConnectAckUnknown,
    mqttPublishPackIdRoll,
    mqttTopicInvalid,
    mqttConnectSuccess,
    mqttMalformedRemainingLen,
    malformedRemainingBytes,
    mqttPacketTypeUnknown,
    mqttSubAckFailed,
    mqttSubAckUnknown,
    mqttTopicCompareFailed,
    mqttExecTimeout,
    mqttTopicTooLong,
    mqttPublishPayloadTooLong,
    mqttRecvInvalidPongPacket,
    mqttRecvInvalidPublishPacket,
    mqttRecvInvalidPubAckPacket,
    mqttUnknownPropertyOption,
    mqttRecvInvalidDisconnectPacket,
    mqttInvalidUserPerpertyData,
    mqttInvalidUserPerpertyLen,
    mqttInvalidTxPacketSize,
    mqttRecvMaxExceeded,
    mqttInvalidSubIdentifier,
    mqttInvalidPropertyLen,

    tlsInvalidCredOption                 = 0x0401,
    tlsInvalidMaxFrangment,
    tlsSetMaxFragmentFailed,
    tlsSetConfigFailed,
    tlsSetupFailed,
    tlsSetHostnameFailed,
    tlsGetVerifyResultFailed,
    tlsInvalidServerCert,
    tlsSocketInvalid,
    tlsRecvFailed,
    tlsSendFailed,
    tlsRecvConnectionClosed,
    tlsSendConnectionClosed,
    tlsInvalidHandshake,

    aiotSuccess                         = 0x0FFF

} MQTTProtocolError;

#endif //_INCLUDE_MQTT_MQTTERROR_H_
